function save() {
	var editState = 0;
	if ("UPDATE" == method) {
		editState = 3;
	} else if ('INSERT' == method) {
		editState = 1;
	}
	var param = RS.getFormData('editForm');
	$.ajax({
			url : RS.webPath + "/admin/rsOauthSystem/edit",
			type : 'post',
			data : 'editState=' + editState + '&method=' + method + '&__paramSet__=' + param,
			dataType : 'json',
			success : function(data) {
				if(data.status==1){
					parent.layer.alert('提交成功',function(index){
						parent.layer.close(index);
						window.location.href=RS.webPath + "/admin/rsOauthSystem";
					});
				}else{
					parent.layer.alert('提交失败');
				}
			}
	});
}

$(function() {
	if ("UPDATE" == method) {
		RS.loadForm('editForm',retInfo);
	}
	var form = layui.form;
	/* 监听提交 */
	form.on('submit(submit-btn)', function(data) {
		save();
		return false;
	});
	form.render();
});
